Density-based dynamic geohash

ABSTRACT

A method and system for maintaining a density-based geocode tree for a geographic area, including obtaining a geocode tree including multiple leaf nodes each having a geohash value corresponding to a subdivision of the geographic area, obtaining multiple positions within the geographic area, generating, using the multiple positions, multiple geohashes, mapping a first subset of the multiple geohashes to a first leaf node of the multiple leaf nodes based on the geohash value of the first leaf node, incrementing, by a cardinality of the first subset, a first counter value for the first leaf node, and grafting, in response to the first counter value exceeding a first density threshold, at least one child node onto the first leaf node.

This application is a Continuation of U.S. patent application Ser. No.14/213,311, filed on Mar. 14, 2014, the entire content of which areincorporated herein by reference.

BACKGROUND

Location information is commonly used by vendors and service providersto reach consumers within a specified range of a target location.

SUMMARY

In general, in one aspect, embodiments of the invention provide a methodfor maintaining a density-based geocode tree for a geographic area,including obtaining a geocode tree including multiple leaf nodes eachhaving a geohash value corresponding to a subdivision of the geographicarea, obtaining multiple positions within the geographic area,generating, using the multiple positions, multiple geohashes, mapping afirst subset of the multiple geohashes to a first leaf node of themultiple leaf nodes based on the geohash value of the first leaf node,incrementing, by a cardinality of the first subset, a first countervalue for the first leaf node, and grafting, in response to the firstcounter value exceeding a first density threshold, at least one childnode onto the first leaf node.

In general, in one aspect, embodiments of the invention provide a systemfor maintaining a density-based geocode tree, including memory and acomputer processor for executing a tree maintenance application storedin memory and causing the computer processor to obtain a geocode treeincluding multiple leaf nodes each having a geohash value correspondingto a subdivision of the geographic area, obtain multiple positionswithin the geographic area, generate, using the multiple positions,multiple geohashes, map a first subset of the multiple geohashes to afirst leaf node of the multiple leaf nodes based on the geohash value ofthe first leaf node, increment, by a cardinality of the first subset, afirst counter value for the first leaf node, and graft, in response tothe first counter value exceeding a first density threshold, at leastone child node onto the first leaf node.

In general, in one aspect, embodiments of the invention provide acomputer readable medium storing instructions for maintaining adensity-based geocode tree, the instructions including functionality toobtain a geocode tree including multiple leaf nodes each having ageohash value corresponding to a subdivision of the geographic area,obtain multiple positions within the geographic area, generate, usingthe multiple positions, multiple geohashes, map a first subset of themultiple geohashes to a first leaf node of the multiple leaf nodes basedon the geohash value of the first leaf node, increment, by a cardinalityof the first subset, a first counter value for the first leaf node, andgraft, in response to the first counter value exceeding a first densitythreshold, at least one child node onto the first leaf node.

Other aspects of the invention will be apparent from the followingdescription and the appended claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 shows a system in accordance with one or more embodiments of theinvention.

FIGS. 2A-2C show an example m accordance with one or more embodiments ofthe invention.

FIG. 3 shows a flowchart in accordance with one or more embodiments ofthe invention.

FIGS. 4A-4B show an example m accordance with one or more embodiments ofthe invention.

FIG. 5 shows a flowchart in accordance with one or more embodiments ofthe invention.

FIGS. 6A and 6B show an example m accordance with one or moreembodiments of the invention.

FIG. 7 shows a computing system m accordance with one or moreembodiments of the invention.

DETAILED DESCRIPTION

Specific embodiments of the invention will now be described in detailwith reference to the accompanying figures. Like elements in the variousfigures are denoted by like reference numerals for consistency.

In the following detailed description of embodiments of the invention,numerous specific details are set forth in order to provide a morethorough understanding of the invention. However, it will be apparent toone of ordinary skill in the art that the invention may be practicedwithout these specific details. In other instances, well-known featureshave not been described in detail to avoid unnecessarily complicatingthe description.

In general, embodiments of the invention are directed to a method andsystem for processing a reverse geocode request (including a globalposition within a geographic area) and returning an identifier of asubdivision of the geographic area that encompasses the position. One ormore embodiments of the invention generate geohash values from globalpositions using varying levels of precision based on a populationdensity map, such that a more precise geohash may be generated from aglobal position in a higher-density region of the geographic area.Conversely, a less precise geohash may be generated from a globalposition in a lower-density region, requiring fewer computationalresources. One or more embodiments of the invention may process reversegeocode requests using a hierarchical data structure based on geohashesof varying precision, thus allowing for faster processing times andlower memory requirements for less populated areas, where greaterprecision may be unnecessary.

FIG. 1 shows a system in accordance with one embodiment of theinvention. As shown in FIG. 1, the system has multiple componentsincluding a geocoder repository (110), a tree maintenance application(120), a mobile device (130), and a frontend module (140). Each of thesecomponents is described in more detail below.

In one or more embodiments of the invention, the geocoder repository(110) is any type of storage unit and/or device (e.g., a file system,database, collection of tables, or any other storage mechanism) forstoring data. Further, the geocoder repository (110) may includemultiple different storage units and/or devices. The multiple differentstorage units and/or devices may or may not be of the same type orlocated at the same physical site.

In one or more embodiments of the invention, the geocoder repository(110) is configured to store one or more geocode tree(s) (112), positiondata (114), and/or any other data relevant to geocode-relatedfunctionality. In one or more embodiments of the invention, geocodingrefers to the process of obtaining a global position (e.g. a set oflatitude and longitude coordinates) from associated geographic data(e.g. street addresses or postal codes). Conversely, reverse geocodingrefers to the opposite process of obtaining associated geographic datafrom a global position. One or more embodiments of a geocode tree (112)are discussed in further detail below. Position data (114) may includeany information identifying one or more global positions, for example,GPS coordinates, postal addresses, geohashes, other geographicidentifiers, or any combination thereof.

The tree maintenance application (120) may be any combination ofhardware, software, and/or firmware. In one or more embodiments of theinvention, the tree maintenance application (120) may includefunctionality to identify a geographic area that includes one or moresubdivisions (i.e. cells in a grid).

The geographic area may be, for example, the planet Earth, the UnitedStates of America, or the city of Chicago. The geographic area may beobtained from the geocoder repository (110), an external source, or maybe predetermined by a user. The geographic area may be divided intosubdivisions of identical size and/or subdivisons of differing sizes.The subdivisions may be non-overlapping, or, in the case of overlappingsubdivisions, one subdivision may encompass one or more additionalsubdivisions.

The tree maintenance application (120) includes functionality to obtainand/or generate a geocode tree of a desired depth. In one or moreembodiments of the invention, a geocode tree is a tree data structurehaving a plurality of nodes including a root node, intermediate nodes,and leaf nodes. In one or more embodiments of the invention, with theexception of the root node, a node in the geocode tree is defined by aunique geohash value that corresponds to a unique subdivision of thegeographic area. In one or more embodiments of the invention, geohash orgeohashing refers to a latitude/longitude geocode system that definessubdivisions of a geographic area by alphanumeric text strings calledgeohashes. Each character position of a geohash corresponds to a furthersubdivision of the cell defined by the character(s) preceding it.Geohashes offer arbitrary precision in that a longer geohash stringrefers to a smaller subdivision of the geographic area. Conversely, alonger geohash can be truncated to reduce its size at the cost of losingprecision. One or embodiments of the invention may be implemented usinggeocode trees obtained and/or generated using other geocode systems thangeohash; for example, GOGGLE's S2.

In one or more embodiments of the invention, the root node of a geocodetree corresponds to the entire identified geographic area and populatesthe zeroth level of the tree. A depth value of the geocode tree refersto a level of the tree beginning with a zero value at the root node andincrementing downward at each subsequent level. The root node has adepth of zero and is not defined by a geohash value. The root node has aplurality of child nodes at the first level of the tree (i.e. having adepth of one), each child node representing a first-order subdivision ofthe geographic area. In one or more embodiments of the invention, eachfirst-level node may be defined by a one-character geohash value. Inother embodiments of the invention, each first-level node may be definedby an n-character geohash value of equal length.

A first level node may have its own plurality of child nodes at thesecond level of the tree (i.e. depth=2), each child node correspondingto a second-order subdivision of the geographic area. In other words,each second-level node corresponds to a further subdivision of thegeographic subdivision represented by the second-level node's parent(first-level) node. Conversely, the geographic subdivision correspondingto a first-level node includes all of the smaller subdivisionsrepresented by the first-level node's child (second-level) nodes, ifany. In a similar fashion, a given node at any level of the treeincludes all of the smaller subdivisions corresponding to that node'schild nodes, if any.

Each second-level node may be defined by a two-character geohash. Thefirst character of a second-level node's geohash value is equal to thegeohash value defining the second-level node's parent (first-level)node. Similarly, the geohash defining a given node at any level of thetree is equal to the geohash value of that node's parent nodeconcatenated with one additional character.

As an example, FIG. 2A shows a geocode tree having three levels ofnodes, in accordance with one or more embodiments of the invention. InFIG. 2A and succeeding figures, the use of collinear dots indicates thatadditional nodes of similar type to the preceding and succeeding nodes(with respect to the dots) may optionally exist. The root node (201) hasno geohash value and a depth of zero.

The two depicted intermediate nodes (203A, 203B) are defined by geohashvalues of “0” and “z” and each intermediate node has a depth of one. Thefour depicted leaf nodes (205A, 205B, 205C, 205D) are defined by geohashvalues of “00”, “Oz”, “zO”, and “zz”, respectively, and each leaf nodehas a depth of two.

FIG. 2B depicts a bounding box on a geographical map corresponding tothe geohash “z” (a value that defines one of the intermediate nodes(203B) in the geocode tree of FIG. 2A). The bounding box is asubdivision of the planet Earth encompassing parts of Russia, NorthKorea, Japan, and surrounding ocean. FIG. 2C depicts a furthersubdivision of the bounding box shown in FIG. 2B, corresponding to ageohash value of “zO” (a value that defines one of the leaf nodes (205C)in the geocode tree of FIG. 2A) and encompassing only parts of NorthKorea and the northern tip of Japan.

Returning to the discussion of FIG. 1, in one or more embodiments of theinvention, the tree maintenance application (120) includes functionalityto obtain multiple positions within a geographic area. Each position maybe in one of a number of formats including, for example, a GPScoordinate set, postal address, zip code, and/or geohash.

In one or more embodiments of the invention, the tree maintenanceapplication (120) includes functionality to receive and process areverse geocode lookup request including a position. For example, thereverse geocode lookup request may include a position expressed as ageohash value. Alternatively, the position may be a GPS coordinate setoriginating from a GPS receiver (132) resident on a mobile device (130).

The tree maintenance application (120) may include functionality togenerate a geohash using a position. In one or more embodiments of theinvention, a geohash may be generated from a position using one of anumber of algorithms. A geohash may be generated, for example, byinterleaving the bits of the latitude and longitude of a positionexpressed in coordinates and encoding the result in base 32 to create aconvenient string representation (i.e. the geohash). In otherembodiments, a geohash may be generated by encoding the interleaved bitsof the position into another format, for example, base 36. The generatedgeohash may then be used in a reverse geocode lookup request to obtain ageographic identifier (e.g. map) of the cell defined by the geohash, forexample, by traversing a hierarchical data structure of references togeographic identifiers.

The tree maintenance application (120) may include functionality to mapone or more geohashes to a leaf node in the geocode tree based on thegeohash value of the leaf node. In one or more embodiments of theinvention, mapping a geohash to a leaf node in the geocode tree mayinclude traversing the geocode tree to identify the leaf node defined bya geohash value matching the geohash. Identifying the leaf node caninvolve an approximate match (reaching a leaf node of the geocode treeusing the first n characters of the geohash) or an exact match (allcharacters of the geohash match the geohash value of the leaf node).

In one or more embodiments of the invention, the tree maintenanceapplication (120) includes functionality to return an identifier of thesubdivision of the geographic area corresponding to the geohash value ofthe mapped leaf node (i.e. the subdivision containing the position usedto generate the geohash). The geohash value defining the identified nodemay be used as input to a hash table to obtain an identifier of theaforementioned subdivision. Alternatively, the leaf node may itselfinclude a reference to an identifier of the subdivision. The treemaintenance application (120) may provide an identifier of thesubdivision and/or additional information associated with thesubdivision (e.g. a business or neighborhood name, a position coordinateor postal address, etc.) in response to a reverse geocode lookuprequest.

In one or more embodiments of the invention, the tree maintenanceapplication (120) includes functionality to increment a counter valuefor the mapped leaf node. The counter value may be incremented by thenumber of geohashes matching the geohash value of the leaf node. Thetree maintenance application (120) may include functionality to comparethe counter value for a leaf node to a density threshold. The densitythreshold may be any predetermined value, or it may be entered by a useror administrator at the time of the comparison.

In one or more embodiments of the invention, the tree maintenanceapplication (120) includes functionality to graft nodes onto the geocodetree and to prune nodes from the geocode tree. Grafting and/or pruningnodes may be performed in response to the counter value for a leaf nodeof the geocode tree exceeding or failing to exceed a density threshold.

The mobile device (130) is a hardware device capable of executingsoftware (e.g., a mobile application). In one or more embodiments of theinvention, the mobile device (130) may be any device includingcapability to obtain one or more positions and communicate theposition(s) to the system 100. Examples of a mobile device (130) mayinclude, but are not limited to, a smartphone, a laptop computer, atablet computer, a PDA, a navigation device, and a netbook computer.

In one or more embodiments of the invention, the mobile device (130)includes a global positioning system (“GPS”) receiver (132). The GPSreceiver (132) is any combination of software, firmware, and/or hardwarethat executes on the mobile device (130) to track the global position ofthe mobile device (130). The GPS receiver (132) may be resident on themobile device (130), or via a wireless connection with another source ofGPS information, for example, a mobile access point. In one or moreembodiments of the invention, the GPS receiver (132) includesfunctionality to provide to the mobile device (130) positions having GPScoordinate or any other format detailing the global position of themobile device (130). The mobile device (130) may be implemented usingother positioning technologies or mechanisms without departing from theinvention.

In one or more embodiments of the invention, the frontend module (140)may include functionality to communicate with external entities (e.g. amobile device (130)). The frontend module (140) may include theapplication programming interface (“API”) and/or any number of othercomponents used for communicating with entities outside of the system(100). The API can include any number of specifications for makingrequests from and/or providing data to the system (100). For example, afunction of the API can provide reverse geocode lookups to a requestingmobile device (130).

While FIG. 1 shows a configuration of components, other configurationsmay be used without departing from the scope of the invention. Forexample, various components may be combined to create a singlecomponent. As another example, the functionality performed by a singlecomponent may be performed by two or more components.

FIG. 3 shows a flowchart for maintaining a density-based geocode tree inaccordance with one or more embodiments of the invention. The processshown in FIG. 3 may be used, for example, with the system of FIG. 1 tomaintain the density-based geocode tree. While the various steps in thisflowchart are presented and described sequentially, one of ordinaryskill will appreciate that some or all of the steps may be executed indifferent orders, may be combined or omitted, and some or all of thesteps may be executed in parallel.

In Step 301, a geocode tree is obtained. The geocode tree may beobtained from a geocode repository. Alternatively, the geocode tree maybe newly generated by the tree maintenance application. The geocode treeincludes a plurality of nodes including leaf nodes, each node having ageohash value corresponding to a subdivision of the geographic area. Inone embodiment of the invention, each non-leaf node in the geocode treehas a maximum of 32 child nodes, corresponding to the 32 alphanumericvalues of a single character in a standard geohash format.

In one or more embodiment of the invention, the obtained or generatedgeocode tree is a perfect tree, meaning that each non-leaf node has themaximum number of child nodes, and that each leaf node has the samedepth (i.e., level) in the geocode tree. In other words, a perfect treeresembles a triangle in appearance. In alternative embodiments, thegeocode tree is a complete tree. In still alternative embodiments, thegeocode tree is a balanced tree. Other types of tree data structures maybe obtained or generated without departing from embodiments of theinvention.

In Step 303, positions within the geographic area are obtained. Forexample, in one or more embodiments of the invention, the treemaintenance application may obtain a position of a mobile device from aGPS receiver resident on the mobile device. Multiple positions may beobtained at once or over a predetermined time interval and from one ormore devices. As an example, the global positions of multiple mobiledevices in a specific time zone may be obtained from those devices oncean hour between the hours of 8 a.m. and 8 p.m. In one or moreembodiments of the invention, the positions may be scraped from Internetmessaging services. For example, all user posts on a particular socialmedia platform posted at 12:18 p.m. may be scraped to provide theembedded positions of those users at that specific time. In otherembodiments, the positions may be obtained from a data source storing,for example, population density data.

In Step 305, geohashes are generated using the positions obtained inStep 303. The geohashes may be generated by applying the above-mentionedalgorithm to the position to obtain an alphanumeric string (i.e.interleaving the longitude and latitude bits of the position andconverting to the desired base). For example, the alphanumeric stringmay be a base 32 string. If the position obtained is in a format otherthan a set of coordinates, for example, a street address or a zip code,the position may be converted to a coordinate format before a geohash isgenerated. The length of the generated geohash may depend on theprecision of the position obtained. For example, converting a coordinatehaving 20 decimal places will generate a longer geohash than convertinga coordinate having 10 decimal places. Additionally, the generatedgeohash may be truncated to a predetermined length.

In Step 307, at least a subset of the geohashes generated in theprevious step are mapped to a leaf node in the geocode tree based on thegeohash value of the leaf node. As stated above, in one or moreembodiments of the invention, this is accomplished by traversing thegeocode tree using the geocode to identify the leaf node matching ncharacters in the geohash. Because the geohash value of a leaf nodecorresponds to a subdivision of the geographic area, a plurality ofgeohashes generated from the obtained positions may map to a single leafnode (indicating that the plurality of positions fall within thesubdivision corresponding to that leaf node). Alternatively, none of thegeohashes generated from the obtained positions may map to any leaf node(indicating that none of the positions fall within the subdivisioncorresponding to that leaf node).

In Step 309, a counter value for the leaf node is incremented by thenumber of geohashes in the subset that map to the leaf node. This numbermay be zero, one, or any ordinal number. In Step 311, the counter valueis compared to a first density threshold. The first density thresholdmay be predetermined by an administrator or a user, or may be determinedautomatically based on, for example, the number of total positionsobtained in Step 303.

In Step 313, at least one child node is grafted onto the leaf node inresponse to the counter value exceeding the first density threshold. Inone or more embodiments of the invention, a full set of child nodes (32nodes, for example) are grafted onto the leaf node, so that futurepositions obtained by the system may be mapped to more precisegeographic subdivisions.

In optional Step 315, it has been determined that the counter value doesnot exceed the first density threshold. The counter value is thencompared to a second density threshold. The second density threshold maybe predetermined by an administrator or a user, or may be determinedautomatically based on, for example, the number of total positionsobtained in Step 303.

In optional Step 317, at least the leaf node is pruned from the geocodetree in response to the second density threshold exceeding the countervalue. In one or more embodiments of the invention, the leaf node andall its siblings are pruned from the geocode tree, in response to thesecond density threshold exceeding the counter values for the leaf nodeand its siblings (indicating that less precision is necessary than thatcurrently provided by the geocode tree).

While the various steps in this flowchart are presented and describedsequentially, one of ordinary skill will appreciate that some or all ofthe steps may be executed in different orders, may be combined oromitted, and some or all of the steps may be executed in parallel.

FIG. 4A shows an exemplary geographic area delimiting multiplesubdivisions, in accordance with one or more embodiments of theinvention. The geographic area is roughly centered on New York City. Thebounded boxes represent subdivisions of the geographic areacorresponding to nodes at the same level in a geocode tree, each nodehaving the geohash value indicated inside the box. The color of theboxes indicate relative population density, with light grey indicating alowest-density subdivision as compared to other bounded subdivisions inFIG. 4A. A dark grey box indicates a highest-density subdivision ascompared to the other bounded subdivisions.

FIG. 4B shows the same exemplary geographic area depicted in FIG. 4Aagain delimiting multiple subdivisions, in accordance with one or moreembodiments of the invention. As in FIG. 4A, the bounded boxes representsubdivisions of the geographic area corresponding to nodes in a geocodetree; however, FIG. 4B includes further subdivisions of thehighest-density boxes depicted in FIG. 4A (400, 402, 404, 406, 408). Inother words, the nodes in the geocode tree corresponding to FIG. 4B arenot all at the same level. Accordingly, FIG. 4B corresponds to a geocodetree resulting from grafting child nodes onto the geocode treecorresponding to FIG. 4A, where the child nodes are grafted based ontheir parent nodes' population densities exceeding a threshold, asdescribed in the steps of FIG. 3.

FIG. 5 shows a flowchart for performing a reverse geocode lookup inaccordance with one or more embodiments of the invention. The processshown in FIG. 5 may be used, for example, with the system of FIG. 1 toperform the reverse geocode lookup. While the various steps in thisflowchart are presented and described sequentially, one of ordinaryskill will appreciate that some or all of the steps may be executed indifferent orders, may be combined or omitted, and some or all of thesteps may be executed in parallel.

In Step 501, a reverse geocode lookup request including a new positionis received by the system. The new position may be in one of a number offormats including, for example, a GPS coordinate set, postal address,zip code, and/or geohash. The reverse geocode lookup request may bereceived, for example, from a mobile device.

In Step 503, a new geohash is generated using the position. The newgeohash is generated in substantially the same manner as geohashes aregenerated using obtained positions in Step 305.

In Step 505, the new geohash is mapped to a leaf node of the geocodetree based on the geohash value of the leaf node. The new geohash ismapped to a leaf node in substantially the same manner as the subset ofgeohashes are mapped to a leaf node in Step 307.

In Step 507, an identifier of the subdivision of the geographic areacorresponding to the geohash value of the leaf node is returned. In oneor more embodiments of the invention, the identifier is a map tiledepicting the subdivision within which the obtained position exists. Inother embodiments, the identifier may have another format properlyidentifying the subdivision. The identifier may be returned to theentity that provided the reverse geocode lookup request, for example,the mobile device specified in Step 401.

The following example, shown in FIGS. 6A and 6B, is for explanatorypurposes only and not intended to limit the scope of the invention. Inother words, the following example is an example of one embodiment ofthe invention. Other embodiments may exist without departing from thescope of the invention.

A geocode tree is obtained having four levels of nodes and correspondingto a geographic area encompassing the planet Earth. The zeroth level ofthe tree includes only the root node, which has no geohash value. Thefirst level of the tree includes 32 child nodes of the root node, eachdefined by a one-character geohash. Each node at the first level of thetree has a geohash value corresponding to an equally-sized 1/32ndsubdivision of the Earth. The leftmost node has a geohash value of “0”,and the rightmost node has a geohash value of “z”. Using a traditionalgeohash system, the node having a geohash value of “d” corresponds to asubdivision of the Earth roughly encompassing the eastern seaboard ofthe United States, the Caribbean, and South America above the equator.

The second level of the tree includes 1,024 (32×32) nodes. Each set of32 nodes are siblings of each other, or in other words, child nodes ofthe same first level parent node. Each node at the second level of thetree has a geohash value corresponding to an equally-sized 1/10241subdivision of the Earth. The leftmost node has a geohash value of “00”,and the rightmost node has a geohash value of “zz”. Using a traditionalgeohash system, the node having a geohash value of “dr” corresponds to asubdivision of the Earth roughly encompassing New England.

The third and final level of the tree includes 32,768 (32×32×32) leafnodes. Each set of 32 leaf nodes are siblings of each other, or in otherwords, child nodes of the same second level parent node. Each node atthe third level of the tree has a geohash value corresponding to anequally-sized 1/32,7681 subdivision of the Earth. The leftmost node hasa geohash value of “000”, and the rightmost node has a geohash value of“zzz”. Using an exemplary geohash system, the node having a geohashvalue of “dr5” corresponds to a subdivision of the Earth roughlyencompassing greater New York City. Additionally, the node having ageohash value of “cb2” corresponds to a subdivision roughly encompassingBismarck, N. Dak. and the surrounding region.

In its present condition, the four level geocode tree offers the samelevel of precision for a reverse geocode lookup request including aposition in New York City and a reverse geocode lookup request includinga position in Bismarck, N. Dak.

Over the course of a given day, individual users collectively post onethousand messages to a popular social media platform, each messageembedded with a coordinate position of the messaging user's mobile phoneat the time the message is posted. The users and their mobile phones aredistributed across the continental United States.

The system obtains the plurality of positions embedded in the messagesjust described. Each position is converted to a geohash. Of theplurality of positions obtained, one position in the vicinity ofBismarck, N. Dak. has the coordinate set 47.5° N and 100.5° W. Using anexemplary geohash algorithm, the geohash “cb2w1” is generated from thiscoordinate set.

The system maps this geohash to the leaf node of the geocode treedefined by the geohash value “cb2.” This mapping is performed bytraversing the geocode tree using the geohash. Specifically, starting atthe root node, the tree is traversed by determining whether the rootnode has a child node defined by the value “c”. Node “c” exists, so thesystem follows the transition to node “c” and then determines whethernode “c” has a child node defined by the value “cb”. This process isrepeated until there are no more valid transitions, or in other words,the process has reached a leaf node (in this case, the leaf node “cb2”).At this point, the geohash “cb2w1” has been mapped to the leaf nodedefined by the geohash value “cb2”.

A counter value for this node is incremented by the number of positions(of the multiple positions obtained) that map to the node. Of this setof positions, only one position is obtained near Bismarck, N. Dak. Acounter value for the node “cb2” is incremented by one. However, twentypositions (of the multiple positions obtained) are in the vicinity ofNew York City. Accordingly, a counter value for the node “dr5” isincremented by twenty.

The counter value for “dr5” is compared to a density threshold. In thiscase, the density threshold has a predefined value of ten. Because thesystem has obtained more than ten positions in the New York City area(and consequently the counter value for dr5 is greater than the densitythreshold), thirty-two child nodes are grafted onto the “dr5” node at anew fourth level of the geocode tree. Each one of these new child nodesis similarly defined by a more precise geohash value equal to the string“dr5” concatenated with an additional character.

At some time thereafter, a user desires to run two reverse geocodelookup requests; the first using a position near Bismarck, N. Dak., andthe second using a position in New York City. The system once againobtains each position, generates a geocode from the position, and mapsthe generated geocode to a leaf node in the geocode tree. Using thegeocode tree manipulated in previous steps, the system maps the Bismarckposition to the “cb2” node, but the New York City position is now mappedto a new “dr5r” node. The system then returns a map tile identifierrepresenting the subdivision of North Dakota corresponding to the “cb2”node. The system also returns a smaller map tile identifier representingthe subdivision of New York City corresponding to the “dr5r” node.Consequently, reverse geocode lookups may now return more preciseinformation using positions in densely populated New York City thanusing positions in sparsely populated Bismarck, N. Dak. Additionally,memory may be saved by using a geocode tree having varying levels ofprecision according to the demands of differing geographic regions.

Without limitation, one or more embodiments of the invention may includereverse-geocoding functionality for use in the following exemplarycases: (i) a cellular carrier determining whether a mobile device fallswithin the carrier's coverage areas; (ii) quickly determining thecountry, province, state, metropolitan area, city, zip code, and/orother toponym that a mobile device's position is within; (iii) efficientlookup of a quantitative attribute associated with a geographicsubdivision, for example, population, per capita income, racialcomposition, pollution level, traffic flow, etc.; and (iv) addressreverse geocoding (i.e. providing a postal address from a given set ofGPS coordinates, accordingly requiring a finely-grained geocode tree).One or more embodiments of the invention may enable maintaining geocodeand reverse-geocode lookup performance while substantially reducing thesize of the required geocode tree (e.g., 10× reduction versus balancedgeocode trees), and providing faster performance in cases whereunnecessarily fine-grained branches can be pruned from a given geocodetree.

Embodiments of the invention may be implemented on virtually any type ofcomputing system regardless of the platform being used. For example, thecomputing system may be one or more mobile devices (e.g., laptopcomputer, smart phone, personal digital assistant, tablet computer, orother mobile device), desktop computers, servers, blades in a serverchassis, or any other type of computing device or devices that includesat least the minimum processing power, memory, and input and outputdevice(s) to perform one or more embodiments of the invention. Forexample, as shown in FIG. 7, the computing system (700) may include oneor more computer processor(s) (702), associated memory (704) (e.g.,random access memory (RAM), cache memory, flash memory, etc.), one ormore storage device(s) (706) (e.g., a hard disk, an optical drive suchas a compact disk (CD) drive or digital versatile disk (DVD) drive, aflash memory stick, etc.), and numerous other elements andfunctionalities. The computer processor(s) (702) may be an integratedcircuit for processing instructions. For example, the computerprocessor(s) may be one or more cores, or micro-cores of a processor.The computing system (700) may also include one or more input device(s)(710), such as a touchscreen, keyboard, mouse, microphone, touchpad,electronic pen, or any other type of input device. Further, thecomputing system (700) may include one or more output device(s) (708),such as a screen (e.g., a liquid crystal display (LCD), a plasmadisplay, touchscreen, cathode ray tube (CRT) monitor, projector, orother display device), a printer, external storage, or any other outputdevice. One or more of the output device(s) may be the same or differentfrom the input device(s). The computing system (700) may be connected toa network (714) (e.g., a local area network (LAN), a wide area network(WAN) such as the Internet, mobile network, or any other type ofnetwork) via a network interface connection (not shown). The input andoutput device(s) may be locally or remotely (e.g., via the network(712)) connected to the computer processor(s) (702), memory (704), andstorage device(s) (706). Many different types of computing systemsexist, and the aforementioned input and output device(s) may take otherforms.

Software instructions in the form of computer readable program code toperform embodiments of the invention may be stored, in whole or in part,temporarily or permanently, on a non-transitory computer readable mediumsuch as a CD, DVD, storage device, a diskette, a tape, flash memory,physical memory, or any other computer readable storage medium.Specifically, the software instructions may correspond to computerreadable program code that when executed by a processor(s), ISconfigured to perform embodiments of the invention.

Further, one or more elements of the aforementioned computing system(700) may be located at a remote location and connected to the otherelements over a network (714). Further, embodiments of the invention maybe implemented on a distributed system having a plurality of nodes,where each portion of the invention may be located on a different nodewithin the distributed system. In one embodiment of the invention, thenode corresponds to a distinct computing device. Alternatively, the nodemay correspond to a computer processor with associated physical memory.The node may alternatively correspond to a computer processor ormicro-core of a computer processor with shared memory and/or resources.

While the invention has been described with respect to a limited numberof embodiments, those skilled in the art, having benefit of thisdisclosure, will appreciate that other embodiments can be devised whichdo not depart from the scope of the invention as disclosed herein.Accordingly, the scope of the invention should be limited only by theattached claims.

1-20. (canceled)
 21. A method for maintaining a density-based geocodetree for a geographic area, the method comprising: obtaining a geocodetree comprising a plurality of leaf nodes each having a geohash valuecorresponding to a subdivision of the geographic area; obtaining, fromembedded positions within messages on a social media platform, aplurality of positions within the geographic area; generating, using theplurality of positions, a plurality of geohashes; mapping a first subsetof the plurality of geohashes to a first leaf node of the plurality ofleaf nodes based on the respective geohash value of the first leaf node;incrementing, by a cardinality of the first subset, a first countervalue for the first leaf node, the first counter value comprising acount of user posts on the social media platform associated with therespective geohash value of the first leaf node; and pruning, inresponse to a first density threshold exceeding the first counter valuefor the first leaf node, the first leaf node and one or more siblings ofthe first leaf node from the geocode tree.
 22. The method of claim 21,further comprising: mapping a second subset of the plurality ofgeohashes to a second leaf node of the plurality of leaf nodes based onthe respective geohash value of the second leaf node; incrementing, by acardinality of the second subset, a second counter value for the secondleaf node, the second counter value comprising a second count of userposts on the social media platform associated with the respectivegeohash value of the second leaf node; and grafting, in response to thesecond counter value exceeding a second density threshold, at least onechild node onto the second leaf node.
 23. The method of claim 21,wherein the geocode tree is of a type selected from a group consistingof a perfect tree, a complete tree, and a balanced tree.
 24. (canceled)25. The method of claim 21, wherein the plurality of positions compriseglobal positions of mobile devices.
 26. The method of claim 21, furthercomprising: receiving, from a client device with a global positioningsystem, a reverse geocode lookup request comprising a new globalposition; generating a new geohash using the new global position;mapping the new geohash to a leaf node of the plurality of leaf nodes ofthe geocode tree based on the geohash value of the leaf node; andreturning an identifier of a subdivision of a geographic areacorresponding to the geohash value of the leaf node.
 27. The method ofclaim 26, wherein the identifier is of a type selected from a groupconsisting of a map tile, an address range, a zip code, and a placename.
 28. The method of claim 26, wherein the reverse geocode lookuprequest comprises a first reverse geocode lookup request, wherein themethod further comprises: receiving, from a second client device with arespective global positioning system, a second reverse geocode lookuprequest comprising a second new global position different than the newglobal position; generating a second new geohash using the second newglobal position, wherein the second new geohash has a length differentthan a length for the new geohash; mapping the second new geohash to asecond leaf node of the plurality of leaf nodes of the geocode treebased on a geohash value of the second leaf node; and returning a secondidentifier of a second subdivision of a geographic area corresponding tothe geohash value of the second leaf node.
 29. The method of claim 21,wherein the second leaf node and the one or more siblings of the secondleaf node are associated with contiguous subdivisions of the geographicarea.
 30. A system for maintaining a density-based geocode tree, thesystem comprising: a computer processor; and a memory configured tostore instructions that are executable by the computer processor to:obtain a geocode tree comprising a plurality of leaf nodes each having ageohash value corresponding to a subdivision of the geographic area;obtain, from embedded positions within messages on a social mediaplatform, a plurality of positions within the geographic area; generate,using the plurality of positions, a plurality of geohashes; map a firstsubset of the plurality of geohashes to a first leaf node of theplurality of leaf nodes based on the respective geohash value of thefirst leaf node; increment, by a cardinality of the first subset, afirst counter value for the first leaf node, the first counter valuecomprising a count of user posts on the social media platform associatedwith the respective geohash value of the first leaf node; and prune, inresponse to a first density threshold exceeding the first counter valuefor the first leaf node, the first leaf node and one or more siblings ofthe first leaf node from the geocode tree.
 31. The system of claim 30,wherein the instructions are further executable by the computerprocessor to: map a second subset of the plurality of geohashes to asecond leaf node of the plurality of leaf nodes based on the respectivegeohash value of the second leaf node; increment, by a cardinality ofthe second subset, a second counter value for the second leaf node, thesecond counter value comprising a second count of user posts on thesocial media platform associated with the respective geohash value ofthe second leaf node; and graft, in response to the second counter valueexceeding a second density threshold, at least one child node onto thesecond leaf node.
 32. The system of claim 30, wherein the geocode treeis of a type selected from a group consisting of a perfect tree, acomplete tree, and a balanced tree.
 33. (canceled)
 34. The system ofclaim 30, wherein the plurality of positions comprise global positionsof mobile devices.
 35. The system of claim 30, wherein the instructionsare further executable by the computer processor to: receive, from aclient device with a global positioning system, a reverse geocode lookuprequest comprising a new global position; generate a new geohash usingthe new global position; map the new geohash to a leaf node of theplurality of leaf nodes of the geocode tree based on a geohash value ofa leaf node; and return an identifier of the subdivision of a geographicarea corresponding to the geohash value of the leaf node.
 36. The systemof claim 35, wherein the identifier is of a type selected from a groupconsisting of a map tile, an address range, a zip code, and a placename.
 37. The system of claim 30, wherein the second leaf node and theone or more siblings of the second leaf node are associated withcontiguous subdivisions of the geographic area.
 38. A non-transitorycomputer readable medium storing instructions for maintaining adensity-based geocode tree, the instructions comprising functionalityto: obtain a geocode tree comprising a plurality of leaf nodes eachhaving a geohash value corresponding to a subdivision of the geographicarea; obtain, from embedded positions within messages on a social mediaplatform, a plurality of positions within the geographic area; generate,using the plurality of positions, a plurality of geohashes; map a firstsubset of the plurality of geohashes to a first leaf node of theplurality of leaf nodes based on the respective geohash value of thefirst leaf node; increment, by a cardinality of the first subset, afirst counter value for the first leaf node, the first counter valuecomprising a count of user posts on the social media platform associatedwith the respective geohash value of the first leaf node; and prune, inresponse to a first density threshold exceeding the first counter valuefor the first leaf node, the first leaf node and one or more siblings ofthe first leaf node from the geocode tree.
 39. The non-transitorycomputer readable medium of claim 38, wherein the instructions furthercomprise functionality to: map a second subset of the plurality ofgeohashes to a second leaf node of the plurality of leaf nodes based onthe respective geohash value of the second leaf node; increment, by acardinality of the second subset, a second counter value for the secondleaf node, the second counter value comprising a second count of userposts on the social media platform associated with the respectivegeohash value of the second leaf node; and graft, in response to thesecond counter value exceeding a second density threshold, at least onechild node onto the second leaf node.
 40. The non-transitory computerreadable medium of claim 38, wherein the instructions further comprisefunctionality to: receive, from a client device with a globalpositioning system, a reverse geocode lookup request comprising a newglobal position; generate a new geohash using the new global position;map the new geohash to a leaf node of the plurality of leaf nodes of thegeocode tree based on a geohash value of the leaf node; and return anidentifier of a subdivision of a geographic area corresponding to thegeohash value of the leaf node, wherein the identifier is of a typeselected from a group consisting of a map tile, an address range, a zipcode, and a place name.
 41. The method of claim 21, wherein obtainingthe plurality of positions within the geographic area comprisesobtaining the plurality of positions from messages on the social mediaplatform transmitted during a predetermined time interval.
 42. Themethod of claim 21, wherein obtaining the plurality of positions withinthe geographic area comprises obtaining the plurality of positions thatare located within a predetermined time zone.
 43. The method of claim21, wherein pruning the first leaf node and the one or more siblings ofthe first leaf node from the geocode tree comprises pruning everysibling of the first leaf node from the geocode tree.
 44. The system ofclaim 30, wherein the geocode tree includes a first set of nodes for afirst subdivision of the geographic area and a second set of nodes for asecond subdivision of the geographic area, the first set of nodes havinga greater number of levels than the second set of nodes, wherein a firstgeohash of a first leaf node of the first set of nodes is more precisethan a second geohash of a second leaf node of the second set of nodes.45. The method of claim 22, wherein said grafting, in response to thesecond counter value exceeding a second density threshold, comprisesgrafting a plurality of child nodes onto the second leaf node, whereinthe plurality of child nodes comprises a respective child node for eachof a plurality of subdivisions of the geographic area to which thesecond leaf node corresponds.